home *** CD-ROM | disk | FTP | other *** search
- #include "stdafx.h"
-
- cThumper::cThumper(int _x, int _y)
- : cWeapon(_x, _y, thumper, "MOVING")
- {
- explode_wait = THUMPER_DELAY;
-
- push_moving_direction = FALSE;
-
- move_object_after_hit = FALSE;
- }
-
- cThumper::~cThumper()
- {
- if (y_on_screen())
- cEffect::make(x, y, orig, "EXPLOSIONS", 5+rnd(5), 80, 5);
- }
-
- static int hit_struct(cMovable *, cDisplayable *s, cCircle *, cCircle *)
- {
- ((cStructure *)s)->explode = TRUE;
-
- return TRUE;
- }
-
- int cThumper::control()
- {
- cWeapon::control();
-
- bounce_on_boundaries();
-
- // Check if we're to explode
-
- if (!explode_wait || explode)
- {
- cCircle c(0, 0, THUMPER_RADIUS);
-
- check_radial_boundaries(&c, structures, hit_struct);
-
- return FALSE;
- }
-
- // Delete when off screen
-
- return !in_water();
- }
-